#include "tcp_server.hpp"
#include <memory>



void usage(char* argv[])
{
    cout << "please input like: " << argv[0] << " port[1024+]" << endl;
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        //命令行参数不正确
        usage(argv);
        return 1;
    }
    uint16_t port = atoi(argv[1]);//将字符串整型
    tcp_server* tcps = new tcp_server(port);
    unique_ptr<tcp_server> ptcps(tcps);
    ptcps->Init();
    ptcps->Start();
    return 0;
}